Skip to content

OPRUN-4070: [OTE] add webhook tests #424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Aug 7, 2025

Migrates OLMv1 webhook operator tests from using external YAML files to defining resources in Go structs. This change removes file dependencies, improving test reliability and simplifying test setup.

The migration is a refactoring of code from openshift/origin#30059. The new code uses better naming conventions and adapts the tests to work with a controller-runtime client, enhancing test consistency and maintainability.

The migration covers all core test scenarios:

  • Validating, mutating, and conversion webhooks.
  • Certificate and secret rotation tolerance.

Local Test

$ ./bin/olmv1-tests-ext run-suite olmv1/all
  [INFO] [env] Using kubeconfig: /Users/camilam/.kube/cluster-bot.kubeconfig[INFO] [env] Cluster environment initialized (OpenShift: true)  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should block cluster upgrades if an incompatible operator is installed
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:147
    STEP: creating namespace install-test-ns-wq2l @ 08/11/25 16:48:09.394
    STEP: ensuring no ClusterExtension no ClusterExtension and CRD for cluster-logging @ 08/11/25 16:48:09.847
    STEP: applying the ClusterExtension resource @ 08/11/25 16:48:10.101
    STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:48:10.231
    STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:48:10.485
    STEP: waiting for the cluster-logging ClusterExtension to be installed @ 08/11/25 16:48:10.742
    STEP: ensuring the cluster is not upgradeable when olm.maxopenshiftversion is specified @ 08/11/25 16:48:15.422
  • [6.820 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 6.821 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to tls secret deletion
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:195
    STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:16.089
    STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:16.089
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:16.29
    STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:16.567
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:16.698
    STEP: installing the webhook operator in namespace webhook-operator-cxvmd @ 08/11/25 16:48:16.698
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:17.075
    STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:17.453
    STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:20.959
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:21.084
    STEP: ensuring secret exists before deletion attempt @ 08/11/25 16:48:21.215
    STEP: checking webhook is responsive through secret recreation after manual deletion @ 08/11/25 16:48:21.351
    STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:48:21.482
  "level"=0 "msg"="Secret webhook-operator-cxvmd/webhook-operator-webhook-service-cert not found yet (still polling for recreation)"
    STEP: performing webhook operator cleanup @ 08/11/25 16:48:32.161
    STEP: cleanup: deleting ClusterExtension webhook-operator-cxvmd @ 08/11/25 16:48:32.161
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-cxvmd-operator-crb @ 08/11/25 16:48:32.301
    STEP: cleanup: deleting ServiceAccount webhook-operator-cxvmd-installer in namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.455
    STEP: cleanup: deleting namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.587
    STEP: waiting for namespace webhook-operator-cxvmd to be fully deleted @ 08/11/25 16:48:32.732
  • [26.765 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 26.765 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working mutating webhook
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:111
    STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:42.855
    STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:42.855
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:42.978
    STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:43.221
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:43.343
    STEP: installing the webhook operator in namespace webhook-operator-b7z5f @ 08/11/25 16:48:43.344
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:43.714
    STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:44.156
    STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:47.657
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:47.778
    STEP: creating a valid webhook test resource @ 08/11/25 16:48:47.91
    STEP: getting the created resource in v1 schema @ 08/11/25 16:48:53.231
    STEP: validating the resource spec @ 08/11/25 16:48:53.351
    STEP: performing webhook operator cleanup @ 08/11/25 16:48:53.351
    STEP: cleanup: deleting ClusterExtension webhook-operator-b7z5f @ 08/11/25 16:48:53.352
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-b7z5f-operator-crb @ 08/11/25 16:48:53.489
    STEP: cleanup: deleting ServiceAccount webhook-operator-b7z5f-installer in namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.621
    STEP: cleanup: deleting namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.756
    STEP: waiting for namespace webhook-operator-b7z5f to be fully deleted @ 08/11/25 16:48:53.888
  • [21.162 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 21.162 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working validating webhook
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:85
    STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:04.018
    STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:04.018
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:04.144
    STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:04.397
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:04.526
    STEP: installing the webhook operator in namespace webhook-operator-xwvfk @ 08/11/25 16:49:04.526
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:04.904
    STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:05.283
    STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:08.782
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:08.903
    STEP: creating a webhook test resource that will be rejected by the validating webhook @ 08/11/25 16:49:09.033
    STEP: performing webhook operator cleanup @ 08/11/25 16:49:14.426
    STEP: cleanup: deleting ClusterExtension webhook-operator-xwvfk @ 08/11/25 16:49:14.426
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-xwvfk-operator-crb @ 08/11/25 16:49:14.565
    STEP: cleanup: deleting ServiceAccount webhook-operator-xwvfk-installer in namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.705
    STEP: cleanup: deleting namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.843
    STEP: waiting for namespace webhook-operator-xwvfk to be fully deleted @ 08/11/25 16:49:14.978
  • [21.084 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 21.085 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should install a cluster extension
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:97
    STEP: creating namespace install-test-ns-jgk5 @ 08/11/25 16:49:25.233
    STEP: ensuring no ClusterExtension and CRD for quay-operator @ 08/11/25 16:49:25.363
    STEP: applying the ClusterExtension resource @ 08/11/25 16:49:25.616
    STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:49:25.741
    STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:49:25.994
    STEP: waiting for the quay-operator ClusterExtension to be installed @ 08/11/25 16:49:26.25
  • [5.235 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 5.235 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:157
    STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:30.34
    STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:30.34
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:30.467
    STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:30.732
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:30.857
    STEP: installing the webhook operator in namespace webhook-operator-47bn9 @ 08/11/25 16:49:30.857
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:31.24
    STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:31.623
    STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:35.125
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:35.253
    STEP: deleting the openshift-service-ca signing-key secret @ 08/11/25 16:49:35.381
    STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:49:35.521
    STEP: checking webhook is responsive through cert rotation @ 08/11/25 16:49:35.647
    STEP: performing webhook operator cleanup @ 08/11/25 16:51:07.24
    STEP: cleanup: deleting ClusterExtension webhook-operator-47bn9 @ 08/11/25 16:51:07.24
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-47bn9-operator-crb @ 08/11/25 16:51:07.383
    STEP: cleanup: deleting ServiceAccount webhook-operator-47bn9-installer in namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.549
    STEP: cleanup: deleting namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.698
    STEP: waiting for namespace webhook-operator-47bn9 to be fully deleted @ 08/11/25 16:51:07.837
  • [142.618 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 142.618 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should fail to install a non-existing cluster extension
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:113
    STEP: creating namespace install-test-ns-rzt6 @ 08/11/25 16:51:53.088
    STEP: ensuring no ClusterExtension and CRD for non-existing operator @ 08/11/25 16:51:53.212
    STEP: applying the ClusterExtension resource @ 08/11/25 16:51:53.337
    STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:51:53.463
    STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:51:53.714
    STEP: waiting for the ClusterExtension to exist @ 08/11/25 16:51:53.977
    STEP: waiting up to 2 minutes for ClusterExtension to report failure @ 08/11/25 16:51:54.113
  • [1.815 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 1.816 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1] OLMv1 should pass a trivial sanity check
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:28
  • [0.000 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 0.000 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working conversion webhook
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:133
    STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:51:54.777
    STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:51:54.777
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:51:54.902
    STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:51:55.153
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:51:55.285
    STEP: installing the webhook operator in namespace webhook-operator-p4lc8 @ 08/11/25 16:51:55.285
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:51:55.67
    STEP: waiting for the webhook operator to be installed @ 08/11/25 16:51:56.045
    STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:51:59.533
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:51:59.663
    STEP: creating a conversion webhook test resource @ 08/11/25 16:51:59.797
    STEP: getting the created resource in v2 schema @ 08/11/25 16:52:07.115
    STEP: validating the resource spec @ 08/11/25 16:52:07.25
    STEP: performing webhook operator cleanup @ 08/11/25 16:52:07.25
    STEP: cleanup: deleting ClusterExtension webhook-operator-p4lc8 @ 08/11/25 16:52:07.25
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-p4lc8-operator-crb @ 08/11/25 16:52:07.382
    STEP: cleanup: deleting ServiceAccount webhook-operator-p4lc8-installer in namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.625
    STEP: cleanup: deleting namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.752
    STEP: waiting for namespace webhook-operator-p4lc8 to be fully deleted @ 08/11/25 16:52:07.886
  • [23.233 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 23.233 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1754927288 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should be installed
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:39
    STEP: verifying CRD clusterextensions.olm.operatorframework.io @ 08/11/25 16:52:18.139
    STEP: verifying CRD clustercatalogs.olm.operatorframework.io @ 08/11/25 16:52:18.278
  • [0.401 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 0.401 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should block cluster upgrades if an incompatible operator is installed",
    "lifecycle": "blocking",
    "duration": 6821,
    "startTime": "2025-08-11 15:48:09.267266 UTC",
    "endTime": "2025-08-11 15:48:16.088457 UTC",
    "result": "passed",
    "output": "  STEP: creating namespace install-test-ns-wq2l @ 08/11/25 16:48:09.394\n  STEP: ensuring no ClusterExtension no ClusterExtension and CRD for cluster-logging @ 08/11/25 16:48:09.847\n  STEP: applying the ClusterExtension resource @ 08/11/25 16:48:10.101\n  STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:48:10.231\n  STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:48:10.485\n  STEP: waiting for the cluster-logging ClusterExtension to be installed @ 08/11/25 16:48:10.742\n  STEP: ensuring the cluster is not upgradeable when olm.maxopenshiftversion is specified @ 08/11/25 16:48:15.422\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to tls secret deletion",
    "lifecycle": "blocking",
    "duration": 33587,
    "startTime": "2025-08-11 15:48:09.267264 UTC",
    "endTime": "2025-08-11 15:48:42.854719 UTC",
    "result": "passed",
    "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:16.089\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:16.089\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:16.29\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:16.567\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:16.698\n  STEP: installing the webhook operator in namespace webhook-operator-cxvmd @ 08/11/25 16:48:16.698\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:17.075\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:17.453\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:20.959\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:21.084\n  STEP: ensuring secret exists before deletion attempt @ 08/11/25 16:48:21.215\n  STEP: checking webhook is responsive through secret recreation after manual deletion @ 08/11/25 16:48:21.351\n  STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:48:21.482\n  STEP: performing webhook operator cleanup @ 08/11/25 16:48:32.161\n  STEP: cleanup: deleting ClusterExtension webhook-operator-cxvmd @ 08/11/25 16:48:32.161\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-cxvmd-operator-crb @ 08/11/25 16:48:32.301\n  STEP: cleanup: deleting ServiceAccount webhook-operator-cxvmd-installer in namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.455\n  STEP: cleanup: deleting namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.587\n  STEP: waiting for namespace webhook-operator-cxvmd to be fully deleted @ 08/11/25 16:48:32.732\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working mutating webhook",
    "lifecycle": "blocking",
    "duration": 54750,
    "startTime": "2025-08-11 15:48:09.267282 UTC",
    "endTime": "2025-08-11 15:49:04.017501 UTC",
    "result": "passed",
    "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:42.855\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:42.855\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:42.978\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:43.221\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:43.343\n  STEP: installing the webhook operator in namespace webhook-operator-b7z5f @ 08/11/25 16:48:43.344\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:43.714\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:44.156\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:47.657\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:47.778\n  STEP: creating a valid webhook test resource @ 08/11/25 16:48:47.91\n  STEP: getting the created resource in v1 schema @ 08/11/25 16:48:53.231\n  STEP: validating the resource spec @ 08/11/25 16:48:53.351\n  STEP: performing webhook operator cleanup @ 08/11/25 16:48:53.351\n  STEP: cleanup: deleting ClusterExtension webhook-operator-b7z5f @ 08/11/25 16:48:53.352\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-b7z5f-operator-crb @ 08/11/25 16:48:53.489\n  STEP: cleanup: deleting ServiceAccount webhook-operator-b7z5f-installer in namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.621\n  STEP: cleanup: deleting namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.756\n  STEP: waiting for namespace webhook-operator-b7z5f to be fully deleted @ 08/11/25 16:48:53.888\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working validating webhook",
    "lifecycle": "blocking",
    "duration": 75835,
    "startTime": "2025-08-11 15:48:09.267287 UTC",
    "endTime": "2025-08-11 15:49:25.102773 UTC",
    "result": "passed",
    "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:04.018\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:04.018\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:04.144\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:04.397\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:04.526\n  STEP: installing the webhook operator in namespace webhook-operator-xwvfk @ 08/11/25 16:49:04.526\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:04.904\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:05.283\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:08.782\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:08.903\n  STEP: creating a webhook test resource that will be rejected by the validating webhook @ 08/11/25 16:49:09.033\n  STEP: performing webhook operator cleanup @ 08/11/25 16:49:14.426\n  STEP: cleanup: deleting ClusterExtension webhook-operator-xwvfk @ 08/11/25 16:49:14.426\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-xwvfk-operator-crb @ 08/11/25 16:49:14.565\n  STEP: cleanup: deleting ServiceAccount webhook-operator-xwvfk-installer in namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.705\n  STEP: cleanup: deleting namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.843\n  STEP: waiting for namespace webhook-operator-xwvfk to be fully deleted @ 08/11/25 16:49:14.978\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should install a cluster extension",
    "lifecycle": "blocking",
    "duration": 81071,
    "startTime": "2025-08-11 15:48:09.267290 UTC",
    "endTime": "2025-08-11 15:49:30.339028 UTC",
    "result": "passed",
    "output": "  STEP: creating namespace install-test-ns-jgk5 @ 08/11/25 16:49:25.233\n  STEP: ensuring no ClusterExtension and CRD for quay-operator @ 08/11/25 16:49:25.363\n  STEP: applying the ClusterExtension resource @ 08/11/25 16:49:25.616\n  STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:49:25.741\n  STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:49:25.994\n  STEP: waiting for the quay-operator ClusterExtension to be installed @ 08/11/25 16:49:26.25\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation",
    "lifecycle": "blocking",
    "duration": 223692,
    "startTime": "2025-08-11 15:48:09.267303 UTC",
    "endTime": "2025-08-11 15:51:52.959333 UTC",
    "result": "passed",
    "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:30.34\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:30.34\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:30.467\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:30.732\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:30.857\n  STEP: installing the webhook operator in namespace webhook-operator-47bn9 @ 08/11/25 16:49:30.857\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:31.24\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:31.623\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:35.125\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:35.253\n  STEP: deleting the openshift-service-ca signing-key secret @ 08/11/25 16:49:35.381\n  STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:49:35.521\n  STEP: checking webhook is responsive through cert rotation @ 08/11/25 16:49:35.647\n  STEP: performing webhook operator cleanup @ 08/11/25 16:51:07.24\n  STEP: cleanup: deleting ClusterExtension webhook-operator-47bn9 @ 08/11/25 16:51:07.24\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-47bn9-operator-crb @ 08/11/25 16:51:07.383\n  STEP: cleanup: deleting ServiceAccount webhook-operator-47bn9-installer in namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.549\n  STEP: cleanup: deleting namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.698\n  STEP: waiting for namespace webhook-operator-47bn9 to be fully deleted @ 08/11/25 16:51:07.837\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should fail to install a non-existing cluster extension",
    "lifecycle": "blocking",
    "duration": 225508,
    "startTime": "2025-08-11 15:48:09.267305 UTC",
    "endTime": "2025-08-11 15:51:54.776210 UTC",
    "result": "passed",
    "output": "  STEP: creating namespace install-test-ns-rzt6 @ 08/11/25 16:51:53.088\n  STEP: ensuring no ClusterExtension and CRD for non-existing operator @ 08/11/25 16:51:53.212\n  STEP: applying the ClusterExtension resource @ 08/11/25 16:51:53.337\n  STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:51:53.463\n  STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:51:53.714\n  STEP: waiting for the ClusterExtension to exist @ 08/11/25 16:51:53.977\n  STEP: waiting up to 2 minutes for ClusterExtension to report failure @ 08/11/25 16:51:54.113\n"
  },
  {
    "name": "[sig-olmv1] OLMv1 should pass a trivial sanity check",
    "lifecycle": "blocking",
    "duration": 225509,
    "startTime": "2025-08-11 15:48:09.267308 UTC",
    "endTime": "2025-08-11 15:51:54.777064 UTC",
    "result": "passed",
    "output": ""
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working conversion webhook",
    "lifecycle": "blocking",
    "duration": 248743,
    "startTime": "2025-08-11 15:48:09.267285 UTC",
    "endTime": "2025-08-11 15:52:18.010672 UTC",
    "result": "passed",
    "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:51:54.777\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:51:54.777\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:51:54.902\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:51:55.153\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:51:55.285\n  STEP: installing the webhook operator in namespace webhook-operator-p4lc8 @ 08/11/25 16:51:55.285\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:51:55.67\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:51:56.045\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:51:59.533\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:51:59.663\n  STEP: creating a conversion webhook test resource @ 08/11/25 16:51:59.797\n  STEP: getting the created resource in v2 schema @ 08/11/25 16:52:07.115\n  STEP: validating the resource spec @ 08/11/25 16:52:07.25\n  STEP: performing webhook operator cleanup @ 08/11/25 16:52:07.25\n  STEP: cleanup: deleting ClusterExtension webhook-operator-p4lc8 @ 08/11/25 16:52:07.25\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-p4lc8-operator-crb @ 08/11/25 16:52:07.382\n  STEP: cleanup: deleting ServiceAccount webhook-operator-p4lc8-installer in namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.625\n  STEP: cleanup: deleting namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.752\n  STEP: waiting for namespace webhook-operator-p4lc8 to be fully deleted @ 08/11/25 16:52:07.886\n"
  },
  {
    "name": "[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should be installed",
    "lifecycle": "blocking",
    "duration": 249145,
    "startTime": "2025-08-11 15:48:09.267274 UTC",
    "endTime": "2025-08-11 15:52:18.412487 UTC",
    "result": "passed",
    "output": "  STEP: verifying CRD clusterextensions.olm.operatorframework.io @ 08/11/25 16:52:18.139\n  STEP: verifying CRD clustercatalogs.olm.operatorframework.io @ 08/11/25 16:52:18.278\n"
  }
]

Assisted-by: Gemini

@camilamacedo86 camilamacedo86 force-pushed the webhook-tests branch 6 times, most recently from fa9edc8 to 80b830a Compare August 7, 2025 23:26
@camilamacedo86 camilamacedo86 changed the title [OTE] add webhook tests WIP: [OTE] add webhook tests Aug 7, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 7, 2025
@camilamacedo86 camilamacedo86 force-pushed the webhook-tests branch 2 times, most recently from aff5c1a to 515db30 Compare August 8, 2025 00:04
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2025
@camilamacedo86 camilamacedo86 force-pushed the webhook-tests branch 5 times, most recently from 1452c6e to 6530e38 Compare August 11, 2025 14:02
@camilamacedo86 camilamacedo86 changed the title WIP: [OTE] add webhook tests OPRUN-4070: [OTE] add webhook tests Aug 11, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 11, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2025

@camilamacedo86: This pull request references OPRUN-4070 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

Migrates OLMv1 webhook operator tests from using external YAML files to defining resources in Go structs. This change removes file dependencies, improving test reliability and simplifying test setup.

The migration is a refactoring of code from openshift/origin#30059. The new code uses better naming conventions and adapts the tests to work with a controller-runtime client, enhancing test consistency and maintainability.

The migration covers all core test scenarios:

  • Validating, mutating, and conversion webhooks.
  • Certificate and secret rotation tolerance.

Local Test

$ ./bin/olmv1-tests-ext run-suite olmv1/all
 [INFO] [env] Using kubeconfig: /Users/camilam/.kube/cluster-bot.kubeconfig[INFO] [env] Cluster environment initialized (OpenShift: true)  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should block cluster upgrades if an incompatible operator is installed
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:147
   STEP: creating namespace install-test-ns-wq2l @ 08/11/25 16:48:09.394
   STEP: ensuring no ClusterExtension no ClusterExtension and CRD for cluster-logging @ 08/11/25 16:48:09.847
   STEP: applying the ClusterExtension resource @ 08/11/25 16:48:10.101
   STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:48:10.231
   STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:48:10.485
   STEP: waiting for the cluster-logging ClusterExtension to be installed @ 08/11/25 16:48:10.742
   STEP: ensuring the cluster is not upgradeable when olm.maxopenshiftversion is specified @ 08/11/25 16:48:15.422
 • [6.820 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 6.821 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to tls secret deletion
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:195
   STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:16.089
   STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:16.089
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:16.29
   STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:16.567
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:16.698
   STEP: installing the webhook operator in namespace webhook-operator-cxvmd @ 08/11/25 16:48:16.698
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:17.075
   STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:17.453
   STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:20.959
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:21.084
   STEP: ensuring secret exists before deletion attempt @ 08/11/25 16:48:21.215
   STEP: checking webhook is responsive through secret recreation after manual deletion @ 08/11/25 16:48:21.351
   STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:48:21.482
 "level"=0 "msg"="Secret webhook-operator-cxvmd/webhook-operator-webhook-service-cert not found yet (still polling for recreation)"
   STEP: performing webhook operator cleanup @ 08/11/25 16:48:32.161
   STEP: cleanup: deleting ClusterExtension webhook-operator-cxvmd @ 08/11/25 16:48:32.161
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-cxvmd-operator-crb @ 08/11/25 16:48:32.301
   STEP: cleanup: deleting ServiceAccount webhook-operator-cxvmd-installer in namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.455
   STEP: cleanup: deleting namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.587
   STEP: waiting for namespace webhook-operator-cxvmd to be fully deleted @ 08/11/25 16:48:32.732
 • [26.765 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 26.765 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working mutating webhook
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:111
   STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:42.855
   STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:42.855
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:42.978
   STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:43.221
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:43.343
   STEP: installing the webhook operator in namespace webhook-operator-b7z5f @ 08/11/25 16:48:43.344
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:43.714
   STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:44.156
   STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:47.657
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:47.778
   STEP: creating a valid webhook test resource @ 08/11/25 16:48:47.91
   STEP: getting the created resource in v1 schema @ 08/11/25 16:48:53.231
   STEP: validating the resource spec @ 08/11/25 16:48:53.351
   STEP: performing webhook operator cleanup @ 08/11/25 16:48:53.351
   STEP: cleanup: deleting ClusterExtension webhook-operator-b7z5f @ 08/11/25 16:48:53.352
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-b7z5f-operator-crb @ 08/11/25 16:48:53.489
   STEP: cleanup: deleting ServiceAccount webhook-operator-b7z5f-installer in namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.621
   STEP: cleanup: deleting namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.756
   STEP: waiting for namespace webhook-operator-b7z5f to be fully deleted @ 08/11/25 16:48:53.888
 • [21.162 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 21.162 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working validating webhook
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:85
   STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:04.018
   STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:04.018
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:04.144
   STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:04.397
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:04.526
   STEP: installing the webhook operator in namespace webhook-operator-xwvfk @ 08/11/25 16:49:04.526
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:04.904
   STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:05.283
   STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:08.782
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:08.903
   STEP: creating a webhook test resource that will be rejected by the validating webhook @ 08/11/25 16:49:09.033
   STEP: performing webhook operator cleanup @ 08/11/25 16:49:14.426
   STEP: cleanup: deleting ClusterExtension webhook-operator-xwvfk @ 08/11/25 16:49:14.426
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-xwvfk-operator-crb @ 08/11/25 16:49:14.565
   STEP: cleanup: deleting ServiceAccount webhook-operator-xwvfk-installer in namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.705
   STEP: cleanup: deleting namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.843
   STEP: waiting for namespace webhook-operator-xwvfk to be fully deleted @ 08/11/25 16:49:14.978
 • [21.084 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 21.085 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should install a cluster extension
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:97
   STEP: creating namespace install-test-ns-jgk5 @ 08/11/25 16:49:25.233
   STEP: ensuring no ClusterExtension and CRD for quay-operator @ 08/11/25 16:49:25.363
   STEP: applying the ClusterExtension resource @ 08/11/25 16:49:25.616
   STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:49:25.741
   STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:49:25.994
   STEP: waiting for the quay-operator ClusterExtension to be installed @ 08/11/25 16:49:26.25
 • [5.235 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 5.235 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:157
   STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:30.34
   STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:30.34
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:30.467
   STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:30.732
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:30.857
   STEP: installing the webhook operator in namespace webhook-operator-47bn9 @ 08/11/25 16:49:30.857
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:31.24
   STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:31.623
   STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:35.125
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:35.253
   STEP: deleting the openshift-service-ca signing-key secret @ 08/11/25 16:49:35.381
   STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:49:35.521
   STEP: checking webhook is responsive through cert rotation @ 08/11/25 16:49:35.647
   STEP: performing webhook operator cleanup @ 08/11/25 16:51:07.24
   STEP: cleanup: deleting ClusterExtension webhook-operator-47bn9 @ 08/11/25 16:51:07.24
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-47bn9-operator-crb @ 08/11/25 16:51:07.383
   STEP: cleanup: deleting ServiceAccount webhook-operator-47bn9-installer in namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.549
   STEP: cleanup: deleting namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.698
   STEP: waiting for namespace webhook-operator-47bn9 to be fully deleted @ 08/11/25 16:51:07.837
 • [142.618 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 142.618 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should fail to install a non-existing cluster extension
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:113
   STEP: creating namespace install-test-ns-rzt6 @ 08/11/25 16:51:53.088
   STEP: ensuring no ClusterExtension and CRD for non-existing operator @ 08/11/25 16:51:53.212
   STEP: applying the ClusterExtension resource @ 08/11/25 16:51:53.337
   STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:51:53.463
   STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:51:53.714
   STEP: waiting for the ClusterExtension to exist @ 08/11/25 16:51:53.977
   STEP: waiting up to 2 minutes for ClusterExtension to report failure @ 08/11/25 16:51:54.113
 • [1.815 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 1.816 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1] OLMv1 should pass a trivial sanity check
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:28
 • [0.000 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 0.000 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working conversion webhook
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:133
   STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:51:54.777
   STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:51:54.777
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:51:54.902
   STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:51:55.153
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:51:55.285
   STEP: installing the webhook operator in namespace webhook-operator-p4lc8 @ 08/11/25 16:51:55.285
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:51:55.67
   STEP: waiting for the webhook operator to be installed @ 08/11/25 16:51:56.045
   STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:51:59.533
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:51:59.663
   STEP: creating a conversion webhook test resource @ 08/11/25 16:51:59.797
   STEP: getting the created resource in v2 schema @ 08/11/25 16:52:07.115
   STEP: validating the resource spec @ 08/11/25 16:52:07.25
   STEP: performing webhook operator cleanup @ 08/11/25 16:52:07.25
   STEP: cleanup: deleting ClusterExtension webhook-operator-p4lc8 @ 08/11/25 16:52:07.25
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-p4lc8-operator-crb @ 08/11/25 16:52:07.382
   STEP: cleanup: deleting ServiceAccount webhook-operator-p4lc8-installer in namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.625
   STEP: cleanup: deleting namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.752
   STEP: waiting for namespace webhook-operator-p4lc8 to be fully deleted @ 08/11/25 16:52:07.886
 • [23.233 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 23.233 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1754927288 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should be installed
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/olmv1.go:39
   STEP: verifying CRD clusterextensions.olm.operatorframework.io @ 08/11/25 16:52:18.139
   STEP: verifying CRD clustercatalogs.olm.operatorframework.io @ 08/11/25 16:52:18.278
 • [0.401 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 0.401 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should block cluster upgrades if an incompatible operator is installed",
   "lifecycle": "blocking",
   "duration": 6821,
   "startTime": "2025-08-11 15:48:09.267266 UTC",
   "endTime": "2025-08-11 15:48:16.088457 UTC",
   "result": "passed",
   "output": "  STEP: creating namespace install-test-ns-wq2l @ 08/11/25 16:48:09.394\n  STEP: ensuring no ClusterExtension no ClusterExtension and CRD for cluster-logging @ 08/11/25 16:48:09.847\n  STEP: applying the ClusterExtension resource @ 08/11/25 16:48:10.101\n  STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:48:10.231\n  STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:48:10.485\n  STEP: waiting for the cluster-logging ClusterExtension to be installed @ 08/11/25 16:48:10.742\n  STEP: ensuring the cluster is not upgradeable when olm.maxopenshiftversion is specified @ 08/11/25 16:48:15.422\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to tls secret deletion",
   "lifecycle": "blocking",
   "duration": 33587,
   "startTime": "2025-08-11 15:48:09.267264 UTC",
   "endTime": "2025-08-11 15:48:42.854719 UTC",
   "result": "passed",
   "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:16.089\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:16.089\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:16.29\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:16.567\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:16.698\n  STEP: installing the webhook operator in namespace webhook-operator-cxvmd @ 08/11/25 16:48:16.698\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:17.075\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:17.453\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:20.959\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:21.084\n  STEP: ensuring secret exists before deletion attempt @ 08/11/25 16:48:21.215\n  STEP: checking webhook is responsive through secret recreation after manual deletion @ 08/11/25 16:48:21.351\n  STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:48:21.482\n  STEP: performing webhook operator cleanup @ 08/11/25 16:48:32.161\n  STEP: cleanup: deleting ClusterExtension webhook-operator-cxvmd @ 08/11/25 16:48:32.161\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-cxvmd-operator-crb @ 08/11/25 16:48:32.301\n  STEP: cleanup: deleting ServiceAccount webhook-operator-cxvmd-installer in namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.455\n  STEP: cleanup: deleting namespace webhook-operator-cxvmd @ 08/11/25 16:48:32.587\n  STEP: waiting for namespace webhook-operator-cxvmd to be fully deleted @ 08/11/25 16:48:32.732\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working mutating webhook",
   "lifecycle": "blocking",
   "duration": 54750,
   "startTime": "2025-08-11 15:48:09.267282 UTC",
   "endTime": "2025-08-11 15:49:04.017501 UTC",
   "result": "passed",
   "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:48:42.855\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:48:42.855\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:48:42.978\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:48:43.221\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:48:43.343\n  STEP: installing the webhook operator in namespace webhook-operator-b7z5f @ 08/11/25 16:48:43.344\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:48:43.714\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:48:44.156\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:48:47.657\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:48:47.778\n  STEP: creating a valid webhook test resource @ 08/11/25 16:48:47.91\n  STEP: getting the created resource in v1 schema @ 08/11/25 16:48:53.231\n  STEP: validating the resource spec @ 08/11/25 16:48:53.351\n  STEP: performing webhook operator cleanup @ 08/11/25 16:48:53.351\n  STEP: cleanup: deleting ClusterExtension webhook-operator-b7z5f @ 08/11/25 16:48:53.352\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-b7z5f-operator-crb @ 08/11/25 16:48:53.489\n  STEP: cleanup: deleting ServiceAccount webhook-operator-b7z5f-installer in namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.621\n  STEP: cleanup: deleting namespace webhook-operator-b7z5f @ 08/11/25 16:48:53.756\n  STEP: waiting for namespace webhook-operator-b7z5f to be fully deleted @ 08/11/25 16:48:53.888\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working validating webhook",
   "lifecycle": "blocking",
   "duration": 75835,
   "startTime": "2025-08-11 15:48:09.267287 UTC",
   "endTime": "2025-08-11 15:49:25.102773 UTC",
   "result": "passed",
   "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:04.018\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:04.018\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:04.144\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:04.397\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:04.526\n  STEP: installing the webhook operator in namespace webhook-operator-xwvfk @ 08/11/25 16:49:04.526\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:04.904\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:05.283\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:08.782\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:08.903\n  STEP: creating a webhook test resource that will be rejected by the validating webhook @ 08/11/25 16:49:09.033\n  STEP: performing webhook operator cleanup @ 08/11/25 16:49:14.426\n  STEP: cleanup: deleting ClusterExtension webhook-operator-xwvfk @ 08/11/25 16:49:14.426\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-xwvfk-operator-crb @ 08/11/25 16:49:14.565\n  STEP: cleanup: deleting ServiceAccount webhook-operator-xwvfk-installer in namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.705\n  STEP: cleanup: deleting namespace webhook-operator-xwvfk @ 08/11/25 16:49:14.843\n  STEP: waiting for namespace webhook-operator-xwvfk to be fully deleted @ 08/11/25 16:49:14.978\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should install a cluster extension",
   "lifecycle": "blocking",
   "duration": 81071,
   "startTime": "2025-08-11 15:48:09.267290 UTC",
   "endTime": "2025-08-11 15:49:30.339028 UTC",
   "result": "passed",
   "output": "  STEP: creating namespace install-test-ns-jgk5 @ 08/11/25 16:49:25.233\n  STEP: ensuring no ClusterExtension and CRD for quay-operator @ 08/11/25 16:49:25.363\n  STEP: applying the ClusterExtension resource @ 08/11/25 16:49:25.616\n  STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:49:25.741\n  STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:49:25.994\n  STEP: waiting for the quay-operator ClusterExtension to be installed @ 08/11/25 16:49:26.25\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation",
   "lifecycle": "blocking",
   "duration": 223692,
   "startTime": "2025-08-11 15:48:09.267303 UTC",
   "endTime": "2025-08-11 15:51:52.959333 UTC",
   "result": "passed",
   "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:49:30.34\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:49:30.34\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:49:30.467\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:49:30.732\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:49:30.857\n  STEP: installing the webhook operator in namespace webhook-operator-47bn9 @ 08/11/25 16:49:30.857\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:49:31.24\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:49:31.623\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:49:35.125\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:49:35.253\n  STEP: deleting the openshift-service-ca signing-key secret @ 08/11/25 16:49:35.381\n  STEP: waiting for the webhook operator's service certificate secret to be recreated and populated @ 08/11/25 16:49:35.521\n  STEP: checking webhook is responsive through cert rotation @ 08/11/25 16:49:35.647\n  STEP: performing webhook operator cleanup @ 08/11/25 16:51:07.24\n  STEP: cleanup: deleting ClusterExtension webhook-operator-47bn9 @ 08/11/25 16:51:07.24\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-47bn9-operator-crb @ 08/11/25 16:51:07.383\n  STEP: cleanup: deleting ServiceAccount webhook-operator-47bn9-installer in namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.549\n  STEP: cleanup: deleting namespace webhook-operator-47bn9 @ 08/11/25 16:51:07.698\n  STEP: waiting for namespace webhook-operator-47bn9 to be fully deleted @ 08/11/25 16:51:07.837\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should fail to install a non-existing cluster extension",
   "lifecycle": "blocking",
   "duration": 225508,
   "startTime": "2025-08-11 15:48:09.267305 UTC",
   "endTime": "2025-08-11 15:51:54.776210 UTC",
   "result": "passed",
   "output": "  STEP: creating namespace install-test-ns-rzt6 @ 08/11/25 16:51:53.088\n  STEP: ensuring no ClusterExtension and CRD for non-existing operator @ 08/11/25 16:51:53.212\n  STEP: applying the ClusterExtension resource @ 08/11/25 16:51:53.337\n  STEP: ensuring ServiceAccount is available before proceeding @ 08/11/25 16:51:53.463\n  STEP: ensuring ClusterRoleBinding is available before proceeding @ 08/11/25 16:51:53.714\n  STEP: waiting for the ClusterExtension to exist @ 08/11/25 16:51:53.977\n  STEP: waiting up to 2 minutes for ClusterExtension to report failure @ 08/11/25 16:51:54.113\n"
 },
 {
   "name": "[sig-olmv1] OLMv1 should pass a trivial sanity check",
   "lifecycle": "blocking",
   "duration": 225509,
   "startTime": "2025-08-11 15:48:09.267308 UTC",
   "endTime": "2025-08-11 15:51:54.777064 UTC",
   "result": "passed",
   "output": ""
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should have a working conversion webhook",
   "lifecycle": "blocking",
   "duration": 248743,
   "startTime": "2025-08-11 15:48:09.267285 UTC",
   "endTime": "2025-08-11 15:52:18.010672 UTC",
   "result": "passed",
   "output": "  STEP: initializing Kubernetes client and dynamic client @ 08/11/25 16:51:54.777\n  STEP: requiring OLMv1 capability on OpenShift @ 08/11/25 16:51:54.777\n  STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/11/25 16:51:54.902\n  STEP: checking if the webhook-operator-catalog exists @ 08/11/25 16:51:55.153\n  STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/11/25 16:51:55.285\n  STEP: installing the webhook operator in namespace webhook-operator-p4lc8 @ 08/11/25 16:51:55.285\n  STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/11/25 16:51:55.67\n  STEP: waiting for the webhook operator to be installed @ 08/11/25 16:51:56.045\n  STEP: waiting for the webhook operator's service to be ready @ 08/11/25 16:51:59.533\n  STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/11/25 16:51:59.663\n  STEP: creating a conversion webhook test resource @ 08/11/25 16:51:59.797\n  STEP: getting the created resource in v2 schema @ 08/11/25 16:52:07.115\n  STEP: validating the resource spec @ 08/11/25 16:52:07.25\n  STEP: performing webhook operator cleanup @ 08/11/25 16:52:07.25\n  STEP: cleanup: deleting ClusterExtension webhook-operator-p4lc8 @ 08/11/25 16:52:07.25\n  STEP: cleanup: deleting ClusterRoleBinding webhook-operator-p4lc8-operator-crb @ 08/11/25 16:52:07.382\n  STEP: cleanup: deleting ServiceAccount webhook-operator-p4lc8-installer in namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.625\n  STEP: cleanup: deleting namespace webhook-operator-p4lc8 @ 08/11/25 16:52:07.752\n  STEP: waiting for namespace webhook-operator-p4lc8 to be fully deleted @ 08/11/25 16:52:07.886\n"
 },
 {
   "name": "[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should be installed",
   "lifecycle": "blocking",
   "duration": 249145,
   "startTime": "2025-08-11 15:48:09.267274 UTC",
   "endTime": "2025-08-11 15:52:18.412487 UTC",
   "result": "passed",
   "output": "  STEP: verifying CRD clusterextensions.olm.operatorframework.io @ 08/11/25 16:52:18.139\n  STEP: verifying CRD clustercatalogs.olm.operatorframework.io @ 08/11/25 16:52:18.278\n"
 }
]

Assisted-by: Gemini

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 11, 2025
@camilamacedo86 camilamacedo86 force-pushed the webhook-tests branch 2 times, most recently from 9104ae3 to 231f5cc Compare August 11, 2025 16:12
Migrates OLMv1 webhook operator tests from using external YAML files to
defining resources in Go structs. This change removes file dependencies,
improving test reliability and simplifying test setup.

The migration is a refactoring of code from openshift/origin#30059.
The new code uses better naming conventions and adapts the tests to work
with a controller-runtime client, enhancing test consistency and maintainability.

The migration covers all core test scenarios:
- Validating, mutating, and conversion webhooks.
- Certificate and secret rotation tolerance.

Assisted-by: Gemini
@camilamacedo86
Copy link
Contributor Author

/test openshift-e2e-aws

Copy link
Contributor

openshift-ci bot commented Aug 12, 2025

@camilamacedo86: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 19447d0 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@anik120 anik120 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message description is confusing to me...how about something like this:

UPSTREAM: <carry>: [OTE] add webhook tests
 
This commit adds webhooks test to OTE, by lifting the tests from https://github.com/openshift/origin/pull/30059

Additional work done after lifting the tests from https://github.com/openshift/origin/pull/30059:

1. Switched from using external YAML files to
 defining resources in Go structs. This change removes file dependencies,
improving test reliability and simplifying test setup.

2. Switched to using a dynamic client (instead of `oc` used in origin tests).
 
    Assisted-by: Gemini

Comment on lines +41 to +60
var (
k8sClient client.Client
dynamicClient dynamic.Interface
webhookOperatorInstallNamespace string
cleanup func(ctx context.Context)
)

BeforeEach(func(ctx SpecContext) {
By("initializing Kubernetes client and dynamic client")
k8sClient = env.Get().K8sClient
restCfg := env.Get().RestCfg
var err error
dynamicClient, err = dynamic.NewForConfig(restCfg)
Expect(err).ToNot(HaveOccurred(), "failed to create dynamic client")

By("requiring OLMv1 capability on OpenShift")
helpers.RequireOLMv1CapabilityOnOpenshift()

By("ensuring no ClusterExtension and CRD from a previous run")
helpers.EnsureCleanupClusterExtension(ctx, webhookOperatorPackageName, webhookOperatorCRDName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var (
k8sClient client.Client
dynamicClient dynamic.Interface
webhookOperatorInstallNamespace string
cleanup func(ctx context.Context)
)
BeforeEach(func(ctx SpecContext) {
By("initializing Kubernetes client and dynamic client")
k8sClient = env.Get().K8sClient
restCfg := env.Get().RestCfg
var err error
dynamicClient, err = dynamic.NewForConfig(restCfg)
Expect(err).ToNot(HaveOccurred(), "failed to create dynamic client")
By("requiring OLMv1 capability on OpenShift")
helpers.RequireOLMv1CapabilityOnOpenshift()
By("ensuring no ClusterExtension and CRD from a previous run")
helpers.EnsureCleanupClusterExtension(ctx, webhookOperatorPackageName, webhookOperatorCRDName)
var (
webhookOperatorInstallNamespace string
cleanup func(ctx context.Context)
)
k8sClient := env.Get().K8sClient
dynamicClient, err := dynamic.NewForConfig(env.Get().RestCfg)
Expect(err).ToNot(HaveOccurred(), "failed to create dynamic client")
helpers.RequireOLMv1CapabilityOnOpenshift()
BeforeEach(func(ctx SpecContext) {
By("ensuring no ClusterExtension and CRD from a previous run")
helpers.EnsureCleanupClusterExtension(ctx, webhookOperatorPackageName, webhookOperatorCRDName)

Why do this in BeforeEach block? This can be done once

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we could do as suggested but that does not change the result/check is doing the same so I think is fine get done in a follow up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of the global variables either. But the net result is the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acctually we cannot do the suggestion with OTE lib

Ginkgo detected an issue with your spec structure
By("initializing Kubernetes client")
/Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:45
  It looks like you are calling By outside of a running spec.  Make sure you
  call By inside a runnable node such as It or BeforeEach and not inside the
  body of a container such as Describe or Context.

  Learn more at: http://onsi.github.io/ginkgo/#documenting-complex-specs-by

make: *** [update-metadata] Error 1

It will fail like above ^

Comment on lines +80 to +85
AfterEach(func(ctx SpecContext) {
By("performing webhook operator cleanup")
if cleanup != nil {
cleanup(ctx)
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is missing a pod log dump that could be helpful in debugging when things go wrong https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR50-R57

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did not add it yet. We can add in a follow-up.
We can track it as a tech debt, and we can add it to all tests afterwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, we need a helper/utils with and that could be used in all tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @anik120 we will add that in a follow up but look that the original code is wrong
The clean ( which will remove the pods ) is called before the dump, so that would not work.

Comment on lines +100 to +103
// Webhook not ready yet; clean up and keep polling.
_ = dynamicClient.Resource(webhookTestGVRV1).
Namespace(webhookOperatorInstallNamespace).
Delete(ctx, name, metav1.DeleteOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a deletion of the web hook happening here?

This is within an eventually block..isn't it sufficient to

  1. Check if there is an error
  2. Check if the error contains the substring we expect

like so: https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR65-R68 ?

The switch case block is just adding verbosity

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The switch is needed to ensure consistent behavior.
Before the webhook server is fully up and returning the expected rejection, we still need to wait until we get that specific error.

There are many ways to implement this — and we might find a better approach later — but since this meets our needs now, I suggest we move forward and handle any improvements in a follow-up.

Comment on lines +241 to +251
var webhookTestGVRV1 = schema.GroupVersionResource{
Group: "webhook.operators.coreos.io",
Version: "v1",
Resource: "webhooktests",
}

var webhookTestGVRV2 = schema.GroupVersionResource{
Group: "webhook.operators.coreos.io",
Version: "v2",
Resource: "webhooktests",
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var webhookTestGVRV1 = schema.GroupVersionResource{
Group: "webhook.operators.coreos.io",
Version: "v1",
Resource: "webhooktests",
}
var webhookTestGVRV2 = schema.GroupVersionResource{
Group: "webhook.operators.coreos.io",
Version: "v2",
Resource: "webhooktests",
}
var webhookGVRv1 = schema.GroupVersionResource{
Group: "webhook.operators.coreos.io",
Version: "v1",
Resource: "testwebhook",
}
var webhookGVRv2 = schema.GroupVersionResource{
Group: "webhook.operators.coreos.io",
Version: "v2",
Resource: "testwebhook",
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matter of preference: we can change in a follow up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not that concerned about variable names... there's a lot here that is basically a nit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot change the names see the orginal it uses webhooktests


		v1WebhookTestClient := c.Resource(schema.GroupVersionResource{
			Group:    "webhook.operators.coreos.io",
			Version:  "v1",
			Resource: "webhooktests",
		}).Namespace(webhookOperatorInstallNamespace)

That needs to match with the solution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot do that. It will fail does not match with the orginal as well
Please, see the original PR. The kind must match with what is in the sample.

Resource: "webhooktests",
}

func newWebhookTestV1(name, namespace string, valid bool) *unstructured.Unstructured {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func newWebhookTestV1(name, namespace string, valid bool) *unstructured.Unstructured {
func newTestWebhook(name, namespace string, valid bool) *unstructured.Unstructured {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matter of preference: I am oK with but we can do in a follow up

obj := &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "webhook.operators.coreos.io/v1",
"kind": "WebhookTest",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"kind": "WebhookTest",
"kind": "TestWebhook",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matter of preference: I am oK with but we can do in a follow up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot do that. It will fail does not match with the orginal as well
Please, see the original PR. The kind must match with what is in the sample.

})

It("should have a working conversion webhook", func(ctx SpecContext) {
By("creating a conversion webhook test resource")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By("creating a conversion webhook test resource")
By("creating a conversion webhook")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a log: Nit I think is fine change in a follow up

@camilamacedo86
Copy link
Contributor Author

Hi @anik120,

Everything you added here doesn’t seem to be a blocker for merging. They’re mostly variable renames, log improvements, and commit message changes. Based on the review, I understand that we are here doing the same tests, am I right?

If we change the PR now, we’ll need to rerun all the tests. Since none of the points raised are actual blockers or compromise the primary goal, I’d suggest we merge them as is, monitor the tests in Sippy, and then handle those improvements in a follow-up.

Does that make sense? It would make sense not to close the webhook tests based on these improvements, or can we for sure do them in a follow-up?

@tmshort
Copy link
Contributor

tmshort commented Aug 12, 2025

/approve

Copy link
Contributor

openshift-ci bot commented Aug 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2025
@anik120
Copy link
Contributor

anik120 commented Aug 12, 2025

Hi @anik120,

Everything you added here doesn’t seem to be a blocker for merging. They’re mostly variable renames, log improvements, and commit message changes. Based on the review, I understand that we are here doing the same tests, am I right?

If we change the PR now, we’ll need to rerun all the tests. Since none of the points raised are actual blockers or compromise the primary goal, I’d suggest we merge them as is, monitor the tests in Sippy, and then handle those improvements in a follow-up.

Does that make sense? It would make sense not to close the webhook tests based on these improvements, or can we for sure do them in a follow-up?

that is true...I don't see any blocking issue in this PR. Let's get it in and start observing sippy

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 9963614 into openshift:main Aug 12, 2025
12 of 13 checks passed
@camilamacedo86
Copy link
Contributor Author

Hi @anik120

But I will work in a follow up to try address all your comments
Thank you for the help and understanding

@camilamacedo86 camilamacedo86 deleted the webhook-tests branch August 12, 2025 19:39
@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: ose-olm-operator-controller
This PR has been included in build ose-olm-operator-controller-container-v4.20.0-202508122224.p0.g9963614.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: ose-olm-catalogd
This PR has been included in build ose-olm-catalogd-container-v4.20.0-202508122224.p0.g9963614.assembly.stream.el9.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants